import { Injectable } from '@angular/core';
import { HttpserviceProvider } from '../httpservice/httpservice';

/*
  Generated class for the BusiserviceProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class BusiserviceProvider {

  constructor(private httpservice: HttpserviceProvider) {
    console.log('Hello BusiserviceProvider Provider');
  }

  login(username, password) {
    return this.httpservice.post("/login/login?username=" + username + "&password=" + password+"&type="+0);
  }
  changePassword(newpassword,oldpassword){
    return this.httpservice.post("/order/changePassword?password="+newpassword+"&oldpassword="+oldpassword);
  }
  getCusWjOrder(){
    return this.httpservice.post("/order/getCusWjOrder");
  }
  getCusYjOrder(){
    return this.httpservice.post("/order/getCusYjOrder");
  }
  addOrder(title,des,type,selectedShop){
    return this.httpservice.post("/order/addOrder?title="+title+"&des="+des+"&type="+type+"&selectedShop="+selectedShop);
  }
  orderDetail(orderid){
    return this.httpservice.post("/order/orderDetail?orderid="+orderid);
  }
  getAllOrderType(){
    return this.httpservice.post("/order/getAllOrderType");
  }
  getUserinfo(){
    return this.httpservice.post("/order/getUserinfo");
  }
  updateuser(user){
    return this.httpservice.post("/order/updateUser",user);
  }
  getShopList(){
    return this.httpservice.post("/order/getShopList");
  }
  getShopInfo(id){
    return this.httpservice.post("/order/getShopInfo?id="+id);
  }
  searchShoplist(searchtext){
    return this.httpservice.post("/order/searchShoplist?searchtext="+searchtext);
  }
  savePj(orderid,pj,star){
    return this.httpservice.post("/order/savePj?orderid="+orderid+"&pj="+pj+"&star="+star);
  }
  regi(user){
    return this.httpservice.post("/login/regi",user);
  }
}
